 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의 신</title>

	<link rel="stylesheet" type="text/css" href="/css/common.css">
	<link rel="stylesheet" type="text/css" href="/css/sub.css">
    <link rel="stylesheet" type="text/css" href="/css/bbs.css">
	
	<link href="/css/lib/myconfig.jquery.validate.css" rel="stylesheet" type="text/css"/>
	
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script src="/js/lib/jquery.validate.min.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		
		$(document).ready(function() {
			
			$('#email_select').change(function() {
				$("#email_select option:selected").each(function () {
					var email_1 = $('#email').val();
					var email_2 = $(this).val();
					
					if (email_1.length > 0) {
						var atIndex = email_1.indexOf('@');
						if (atIndex >= 0) {
							email_1 = email_1.substring(0, atIndex);
						}
					}
					
					var email = email_1 + '@' + email_2;
					$('#email').val(email);
					$('#email').focus();
				});
			});
			
			// 제목 입력 안내 메세지
			var subject_msg = "제목을 입력하세요.";
			$("#subject").val(subject_msg);
			$("#subject").bind({
				focus: function() {
					if( $(this).val() == subject_msg ) {
						$(this).val('');
					}
				},
				blur: function() {
					if( $(this).val() == '') {
						$(this).val(subject_msg);
					}
				}
			});
			
			// 내용 입력 안내 메세지
			var content_msg = "욕설, 비방등 게시물의 성격과 맞지 않는 글은 관리자에 의해 삭제될 수 있습니다.";
			$("#comment").val(content_msg);
			$("#comment").bind({
				focus: function() {
					if( $(this).val() == content_msg ) {
						$(this).val('');
					}
				},
				blur: function() {
					if( $(this).val() == '') {
						$(this).val(content_msg);
					}
				}
			});
			
			$("#frm").submit(function() {
				var subject = $("#subject").val();
				var comment = $("#comment").val();
				var userfile = $("#userfile").val();
				if (subject == '' || subject == subject_msg) {
					alert('제목을 입력하세요.');
					$("#subject").focus();
					return false;
				} else if (comment == '' || comment == content_msg) {
					alert('내용을 입력하세요.');
					$("#comment").focus();
					return false;
				} else if (userfile != '' && !(/.*\.(gif)|(jpg)$/.test(userfile.toLowerCase()))) {
					alert('업로드 할수 없는 파일입니다.');
					return false;
				}
				var cellphone =  $('#cell_1').val()+"-"+$('#cell_2').val()+"-"+$('#cell_3').val();
				$("#comment").val(comment+"\n\n이름:"+$('#user_name').val()+"\n연락처:"+cellphone+"\n이메일:"+$('#email').val());
			});
		});
	</script>

</head>
<body>

<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_header.php'; ?>
	<!--// Header -->

	<!--커튼 데코레이션-->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/drape.php'; ?>
	<!--//커튼 데코레이션-->
    
    <!--컨텐츠-->
	<div id="content">
		<!--휘장-->
		<div class="keybox1">
		</div>
		<!--휘장-->

		<!--왼쪽 컨텐츠-->
		<div class="assistant">
			<!--왼쪽 메뉴-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/inc_lnb.php'; ?>
			<!--// 왼쪽 메뉴-->
			
			<!--추천테마-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/theme.php'; ?>
			<!--//추천테마-->
			
			<!--오늘의 추천! 무료운세-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/free.php'; ?>
			<!--//오늘의 추천! 무료운세-->
			
			<!--후기게시판-->
			<?php echo $INC_POSTSCRIPT_LIST ?>
			<!--//후기게시판-->
			
			<!--회원배너-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/member_join.php'; ?>
			<!--//회원배너-->
		</div>
		<!--//왼쪽 컨텐츠-->

		<!-- 메인컨텐츠-->
		<div class="cont">
        <!--리스트-->
			<div class="bbs">
				<h3><?=$category_title?></h3>
				<!--게시판-->
				<div class="write">
					<form name="frm" id="frm" method="post" enctype="multipart/form-data" action="/bbs/<?=$cate?>/write_ok">
						<fieldset>
							<legend>글쓰기</legend>
							<table width="100%" summary="글쓰기" cellpadding="0" cellspacing="0">
								<caption class="blind">게시판글쓰기</caption>
								<colgroup>
									<col width="140" />
									<col width="*" />
								</colgroup>
								<tbody>
									<tr class="write">
										<th scope="row" class="writer">아이디</th>
										<td><?=$sess_userinfo['user_id']?><input type="hidden" name="user_name" id="user_name" value="<?=$sess_userinfo['user_name']?>" /></td>
									</tr>
                                    <tr>
										<th scope="row" class="tle">이메일</th>
										<td>
											<input type="text" name="email" id="email" title="이메일을 작성하세요." class="inpText" />
											<select id="email_select" name="email_select" title="이메일 도메인을 선택하세요." class="input_select" >
>												<option value="">직접입력</option>
												<option value="naver.com">naver.com</option>
												<option value="nate.com">nate.com</option>
												<option value="hanmail.net">hanmail.net</option>
												<option value="gmail.com">gmail.com</option>
												<option value="paran.com">paran.com</option>
												<option value="yahoo.co.kr">yahoo.co.kr</option>
												<option value="dreamwiz.com">dreamwiz.com</option>
												<option value="empal.com">empal.com</option>
												<option value="hotmail.com">hotmail.com</option>
												<option value="korea.com">korea.com</option>
												<option value="lycos.co.kr">lycos.co.kr</option>
											</select>
										</td>
									</tr>
                                    <tr>
										<th scope="row" class="tle">연락처</th>
										<td>
											<select name="cell_1" id="cell_1" title="서비스 번호를 선택하세요" class="input_select">
												<option value="010">010</option>
												<option value="011">011</option>
												<option value="016">016</option>
												<option value="017">017</option>
												<option value="018">018</option>
												<option value="019">019</option>
											</select>
											 - 
											<input type="text" name="cell_2" id="cell_2" size="4" maxlength="4" value="" title="전화번호 가운데자리를 입력하세요." alt="phone"  class="inpText"/>
											 - 
											<input type="text" name="cell_3" id="cell_3" size="4" maxlength="4" value="" title="전화번호 뒷자리를 입력하세요." alt="phone" class="inpText" />
										</td>
									</tr>
                                    <tr>
										<th scope="row" class="tle">제목</th>
										<td>
											<input type="text" name="subject" id="subject" size="100" maxlength="100" class="inpText" />
										</td>
									</tr>
									<tr>
										<th scope="row" class="tle">파일첨부</th>
										<td>
											<input type="file" name="userfile" id="userfile" />
											<span class="text">
												첨부파일은 JPG, GIF 이미지 파일만 등록 가능합니다.<br />
						   						용량은 1MB이하, 해상도는 가로 1920, 세로 1080 픽셀만 등록 가능합니다.
						   					</span>
										</td>
									</tr>
									<tr>
										<th scope="row" class="tle end">내용</th>
										<td class="con end">
											<textarea name="content" id="comment"></textarea>
										</td>
									</tr>
								</tbody>
								<tfoot>
									<tr>
										<td colspan="2" class="boardbt_area">
											<input type="image" src="/images/common/board/bt_submit.png" alt="등록하기" />
											<img src="/images/common/board/bt_cancle2.png" onclick="location.href='/';" alt="취소하기" style="cursor: pointer" />
										</td>
									</tr>
								</tfoot>
							</table>
						</fieldset>
					</form>
				</div>
				<!--//게시판-->
			</div>
			<!--//리스트--> 
		</div>
		<!--// 메인컨텐츠-->
	</div>
	<!--컨텐츠-->
	
	

	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_footer.php'; ?>
	<!--// Footer -->
</div>
</body>
</html>